static inline double doublemax(double a, double b) {
    return a>b?a:b;
}

typedef struct {
    int isPut;
    int isAmerican;
    int isEuropean;
    int isAsianA;
    int isAsianG;
    int controlVariates;
    int isDigital;
    int antithetic;
    int doPrint;
    int nTrials;
    int seed;
    int stepsPerOutput;
    int checksPerYear;
    int bumpRenewSeed;
    int likelihoodRatio;
    double S0;
    double strikePrice;
    double sigma;
    double r;
    double endTime;
    double asianValue;
    double controlBeta;
    double bumpEps;
} mcPars;

typedef struct {
    double optionValue;
    double hedge;
    double stdErr;
} mcResults;

void getPars(int argc, char *argv[], mcPars *pars);
void mcOption(mcPars *pars, mcResults *results);

double stockSim(mcPars *pars, gsl_rng *randomNumGen);
double stockSimCtrl(mcPars *pars, gsl_rng *randomNumGen);
